<?php
/**
 * Created by PhpStorm.
 * User: xuaq
 * Date: 2019/2/27
 * Time: 15:59
 */

namespace App\Modules\Rtdata;


use App\Modules\Rtdata\Process\BuyOrderProcess;
use App\Modules\Rtdata\Repositories\OrderPubSubRepository;

class GlobalRtDataService
{
    protected $orderRepo;

    public function __construct(OrderPubSubRepository $orderRepo)
    {
        $this->orderRepo = $orderRepo;
    }

    public function publishBuyOrderChange(array $buy_order)
    {
        return $this->orderRepo->buyOrderPublish($buy_order);
    }

    public function subscribeBuyOrderChange()
    {
        $this->orderRepo->subscribeBuyOrder((new BuyOrderProcess()));
    }
}